// bind 是返回一个函数
Function.prototype.bind2=function(thisArg,...args1){
    let self=this

    return function(...args2){
        thisArg=thisArg||window
        const fn=Symbol('fn')
        thisArg[fn]=self
        let result=thisArg[fn](...args1,...args2)
        delete thisArg[fn]
        return result
        // 以上可以概括为self.call(thisArg,...args1,...args2)
    }
}
function a(x){
    console.log(this.name,this.age);
    console.log(x);
}
let obj1={
    name:'坤坤',
    age:18
}
const b=a.bind(obj1,1)
b()
